<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据大屏</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script>
        // 页面加载时设置默认用户信息
        (function() {
            // 设置默认的数据大屏用户信息
            if (!localStorage.getItem('dataDashboardCurrentUser')) {
                localStorage.setItem('dataDashboardCurrentUser', JSON.stringify({
                    name: '数据大屏管理员',
                    role: '数据大屏管理员'
                }));
                localStorage.setItem('dataDashboardIsLoggedIn', 'true');
            }
        })();
    </script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
            color: #ffffff;
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }

        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
        }

        .container {
            display: flex;
            min-height: 100vh;
            position: relative;
            z-index: 1;
        }

        /* 左侧侧边栏 */
        .sidebar {
            width: 280px;
            background: linear-gradient(180deg, rgba(30, 30, 46, 0.95) 0%, rgba(45, 45, 68, 0.95) 50%, rgba(61, 61, 95, 0.95) 100%);
            color: white;
            padding: 0;
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
            position: fixed;
            height: 100vh;
            overflow-y: auto;
            backdrop-filter: blur(20px);
            border-right: 1px solid rgba(255, 255, 255, 0.1);
        }

        .sidebar-header {
            padding: 30px 20px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            margin-bottom: 20px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .sidebar-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            animation: shimmer 3s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .sidebar-title {
            font-size: 22px;
            font-weight: bold;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            background: linear-gradient(45deg, #00d4ff, #ff6b6b, #00d4ff);
            background-size: 200% 200%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: gradientShift 3s ease infinite;
            position: relative;
            z-index: 1;
        }

        @keyframes gradientShift {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }

        .nav-menu {
            list-style: none;
            padding: 0 15px;
        }

        .nav-item {
            margin-bottom: 8px;
        }

        .nav-link {
            display: flex;
            align-items: center;
            padding: 15px 20px;
            color: white;
            text-decoration: none;
            border-radius: 12px;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            border-left: 4px solid transparent;
        }

        .nav-link::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
        }

        .nav-link:hover::before {
            left: 100%;
        }

        .nav-link:hover {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
            border-left-color: #00d4ff;
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        .nav-link.active {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(255, 107, 107, 0.1));
            border-left-color: #00d4ff;
            box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
            transform: translateX(5px);
        }

        .nav-icon {
            font-size: 20px;
            margin-right: 12px;
            width: 24px;
            text-align: center;
            transition: transform 0.3s ease;
        }

        .nav-link:hover .nav-icon {
            transform: scale(1.2);
        }

        .nav-text {
            font-size: 16px;
            font-weight: 500;
        }

        /* 主内容区域 */
        .main-content {
            flex: 1;
            margin-left: 280px;
            padding: 30px;
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(20px);
            border-radius: 20px 0 0 20px;
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        /* 顶部信息栏 */
        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding: 20px 30px;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
            border-radius: 15px;
            color: white;
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            position: relative;
            overflow: hidden;
        }

        .top-bar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #00d4ff, #ff6b6b, #00d4ff);
            background-size: 200% 100%;
            animation: gradientMove 3s ease infinite;
        }

        @keyframes gradientMove {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .page-title {
            font-size: 28px;
            font-weight: bold;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            background: linear-gradient(45deg, #ffffff, #00d4ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            position: relative;
            z-index: 1;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .user-avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(255, 107, 107, 0.3));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: bold;
            border: 2px solid rgba(255, 255, 255, 0.3);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .user-avatar::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transform: rotate(45deg);
            transition: transform 0.6s;
        }

        .user-avatar:hover::before {
            transform: rotate(45deg) translate(50%, 50%);
        }

        .user-avatar:hover {
            transform: scale(1.1);
            box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
        }

        .user-details {
            text-align: right;
        }

        .user-name {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .user-role {
            font-size: 14px;
            opacity: 0.9;
        }

        .logout-btn {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
        }

        .logout-btn:hover {
            background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 107, 107, 0.1));
            border-color: rgba(255, 107, 107, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
        }

        /* 内容区域 */
        .content-section {
            display: none;
            animation: fadeIn 0.5s ease;
        }

        .content-section.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 数据大屏模块 */
        .dashboard-module {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
        }

        .module-header {
            font-size: 24px;
            font-weight: bold;
            color: #00d4ff;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.2);
            position: relative;
        }

        .module-header::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 60px;
            height: 2px;
            background: linear-gradient(90deg, #00d4ff, #ff6b6b);
        }

        /* 统计卡片 */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            text-align: center;
            backdrop-filter: blur(15px);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transition: left 0.6s;
        }

        .stat-card:hover::before {
            left: 100%;
        }

        .stat-card:hover {
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
            border-color: rgba(0, 212, 255, 0.3);
        }

        .stat-number {
            font-size: 36px;
            font-weight: bold;
            background: linear-gradient(45deg, #00d4ff, #ff6b6b);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
            text-shadow: none;
            position: relative;
            z-index: 1;
        }

        .stat-label {
            font-size: 16px;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 500;
            position: relative;
            z-index: 1;
        }

        /* 图表容器 */
        .chart-container {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(15px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .chart-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #00d4ff, #ff6b6b, #00d4ff);
            background-size: 200% 100%;
            animation: gradientMove 4s ease infinite;
        }

        .chart-container:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
            border-color: rgba(0, 212, 255, 0.2);
        }

        .chart-title {
            font-size: 20px;
            font-weight: bold;
            background: linear-gradient(45deg, #ffffff, #00d4ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 25px;
            text-align: center;
            position: relative;
            z-index: 1;
        }

        .chart-wrapper {
            position: relative;
            height: 400px;
            width: 100%;
            border-radius: 10px;
            overflow: hidden;
        }

        /* 表格样式 */
        .table-container {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(15px);
            transition: all 0.3s ease;
        }

        .table-container:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
            border-color: rgba(0, 212, 255, 0.2);
        }

        .table-header {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
            color: white;
            padding: 25px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            overflow: hidden;
        }

        .table-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #00d4ff, #ff6b6b, #00d4ff);
            background-size: 200% 100%;
            animation: gradientMove 3s ease infinite;
        }

        .table-title {
            font-size: 20px;
            font-weight: bold;
            background: linear-gradient(45deg, #ffffff, #00d4ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            position: relative;
            z-index: 1;
        }

        .data-table {
            width: 100%;
            border-collapse: collapse;
        }

        .data-table th {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
            padding: 18px 15px;
            text-align: left;
            font-weight: 600;
            color: #ffffff;
            border-bottom: 2px solid rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
        }

        .data-table td {
            padding: 18px 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.9);
            transition: all 0.3s ease;
        }

        .data-table tr {
            transition: all 0.3s ease;
        }

        .data-table tr:hover {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
            transform: translateX(5px);
        }

        .rank-badge {
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .rank-badge::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s;
        }

        .rank-badge:hover::before {
            left: 100%;
        }

        .rank-1 {
            background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
            background-size: 200% 200%;
            color: #000;
            animation: gradientShift 2s ease infinite;
        }

        .rank-2 {
            background: linear-gradient(45deg, #c0c0c0, #e5e5e5, #c0c0c0);
            background-size: 200% 200%;
            color: #000;
            animation: gradientShift 2.5s ease infinite;
        }

        .rank-3 {
            background: linear-gradient(45deg, #cd7f32, #daa520, #cd7f32);
            background-size: 200% 200%;
            color: #fff;
            animation: gradientShift 3s ease infinite;
        }

        .rank-other {
            background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .sidebar {
                width: 100%;
                position: relative;
                height: auto;
            }

            .main-content {
                margin-left: 0;
                border-radius: 0;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .chart-wrapper {
                height: 300px;
            }
        }

        /* 实时数据更新动画 */
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        .stat-card.updating {
            animation: pulse 1s ease-in-out;
        }

        /* 粒子背景效果 */
        .particles {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
        }

        .particle {
            position: absolute;
            width: 2px;
            height: 2px;
            background: rgba(0, 212, 255, 0.6);
            border-radius: 50%;
            animation: float 6s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% {
                transform: translateY(0px) translateX(0px);
                opacity: 0;
            }
            10% {
                opacity: 1;
            }
            90% {
                opacity: 1;
            }
            50% {
                transform: translateY(-100px) translateX(50px);
                opacity: 0.8;
            }
        }

        /* 数据卡片特殊效果 */
        .stat-card:nth-child(1) {
            border-left: 4px solid #00d4ff;
        }

        .stat-card:nth-child(2) {
            border-left: 4px solid #ff6b6b;
        }

        .stat-card:nth-child(3) {
            border-left: 4px solid #4ecdc4;
        }

        .stat-card:nth-child(4) {
            border-left: 4px solid #45b7d1;
        }

        /* 鼠标悬停时的光晕效果 */
        .stat-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 15px;
            background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.1), transparent);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .stat-card:hover::after {
            opacity: 1;
        }

        /* 点击效果 */
        .stat-card:active {
            transform: translateY(-4px) scale(0.98);
        }

        /* 数据更新时的闪烁效果 */
        @keyframes flash {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .stat-card.flash {
            animation: flash 0.5s ease-in-out;
        }

        /* 表格行悬停时的渐变效果 */
        .data-table tr {
            position: relative;
        }

        .data-table tr::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .data-table tr:hover::before {
            opacity: 1;
        }

        /* 数据趋势指示器 */
        .trend-indicator {
            display: inline-block;
            margin-left: 10px;
            font-size: 12px;
            padding: 4px 10px;
            border-radius: 15px;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .trend-indicator::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s;
        }

        .trend-indicator:hover::before {
            left: 100%;
        }

        .trend-up {
            background: linear-gradient(45deg, rgba(0, 255, 0, 0.3), rgba(0, 255, 0, 0.1));
            color: #00ff00;
            border: 1px solid rgba(0, 255, 0, 0.5);
        }

        .trend-down {
            background: linear-gradient(45deg, rgba(255, 0, 0, 0.3), rgba(255, 0, 0, 0.1));
            color: #ff0000;
            border: 1px solid rgba(255, 0, 0, 0.5);
        }

        .trend-stable {
            background: linear-gradient(45deg, rgba(255, 255, 0, 0.3), rgba(255, 255, 0, 0.1));
            color: #ffff00;
            border: 1px solid rgba(255, 255, 0, 0.5);
        }
    </style>
</head>
<body>
    <!-- 粒子背景 -->
    <div class="particles" id="particles"></div>
    
    <div class="container">
        <!-- 左侧侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-header">
                <div class="sidebar-title">数据大屏</div>
            </div>
            <ul class="nav-menu">
                <li class="nav-item">
                    <a href="#" class="nav-link active" onclick="switchFunction('registration-dashboard')">
                        <span class="nav-icon">📊</span>
                        <span class="nav-text">登记数据大屏</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="#" class="nav-link" onclick="switchFunction('donation-dashboard')">
                        <span class="nav-icon">💝</span>
                        <span class="nav-text">捐献数据大屏</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="index.html" class="nav-link">
                        <span class="nav-icon">🏠</span>
                        <span class="nav-text">返回主页</span>
                    </a>
                </li>
            </ul>
        </div>

        <!-- 主内容区域 -->
        <div class="main-content">
            <!-- 顶部信息栏 -->
            <div class="top-bar">
                <div class="page-title">数据大屏</div>
                <div class="user-info">
                    <div class="user-avatar" id="user-avatar">数</div>
                    <div class="user-details">
                        <div class="user-name" id="user-name">数据大屏管理员</div>
                        <div class="user-role" id="user-role">数据大屏管理员</div>
                    </div>
                    <button class="logout-btn" onclick="logout()">退出登录</button>
                </div>
            </div>

            <!-- 登记数据大屏 -->
            <div id="registration-dashboard-content" class="content-section active">
                <div class="dashboard-module">
                    <div class="module-header">登记数据大屏</div>
                    
                    <!-- 统计卡片 -->
                    <div class="stats-grid">
                        <div class="stat-card">
                            <div class="stat-number">12,456</div>
                            <div class="stat-label">总登记数量</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number">1,234</div>
                            <div class="stat-label">本年度新增</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number">89</div>
                            <div class="stat-label">本月新增</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number">12</div>
                            <div class="stat-label">今日新增</div>
                        </div>
                    </div>

                    <!-- 登记数量走势图 -->
                    <div class="chart-container">
                        <div class="chart-title">登记数量走势</div>
                        <div class="chart-wrapper">
                            <canvas id="registrationTrendChart"></canvas>
                        </div>
                    </div>

                    <!-- 登记数量排名 -->
                    <div class="table-container">
                        <div class="table-header">
                            <div class="table-title">登记数量排名</div>
                        </div>
                        <table class="data-table">
                            <thead>
                                <tr>
                                    <th>排名</th>
                                    <th>地区/部门</th>
                                    <th>登记数量</th>
                                    <th>占比</th>
                                    <th>增长率</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><span class="rank-badge rank-1">1</span></td>
                                    <td>北京市朝阳区</td>
                                    <td>2,345</td>
                                    <td>18.8%</td>
                                    <td><span class="trend-indicator trend-up">+12.5%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-2">2</span></td>
                                    <td>上海市浦东新区</td>
                                    <td>2,156</td>
                                    <td>17.3%</td>
                                    <td><span class="trend-indicator trend-up">+8.7%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-3">3</span></td>
                                    <td>广州市天河区</td>
                                    <td>1,987</td>
                                    <td>16.0%</td>
                                    <td><span class="trend-indicator trend-up">+15.2%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-other">4</span></td>
                                    <td>深圳市南山区</td>
                                    <td>1,756</td>
                                    <td>14.1%</td>
                                    <td><span class="trend-indicator trend-stable">+2.3%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-other">5</span></td>
                                    <td>杭州市西湖区</td>
                                    <td>1,234</td>
                                    <td>9.9%</td>
                                    <td><span class="trend-indicator trend-down">-1.2%</span></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- 捐献数据大屏 -->
            <div id="donation-dashboard-content" class="content-section">
                <div class="dashboard-module">
                    <div class="module-header">捐献数据大屏</div>
                    
                    <!-- 统计卡片 -->
                    <div class="stats-grid">
                        <div class="stat-card">
                            <div class="stat-number">8,765</div>
                            <div class="stat-label">累计捐献数量</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number">987</div>
                            <div class="stat-label">本年度捐献</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number">67</div>
                            <div class="stat-label">本月捐献</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number">8</div>
                            <div class="stat-label">今日捐献</div>
                        </div>
                    </div>

                    <!-- 捐献数据统计图 -->
                    <div class="chart-container">
                        <div class="chart-title">捐献数据统计</div>
                        <div class="chart-wrapper">
                            <canvas id="donationStatsChart"></canvas>
                        </div>
                    </div>

                    <!-- 捐献数量排名 -->
                    <div class="table-container">
                        <div class="table-header">
                            <div class="table-title">捐献数量排名</div>
                        </div>
                        <table class="data-table">
                            <thead>
                                <tr>
                                    <th>排名</th>
                                    <th>地区/部门</th>
                                    <th>捐献数量</th>
                                    <th>占比</th>
                                    <th>增长率</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><span class="rank-badge rank-1">1</span></td>
                                    <td>北京市朝阳区</td>
                                    <td>1,234</td>
                                    <td>14.1%</td>
                                    <td><span class="trend-indicator trend-up">+18.5%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-2">2</span></td>
                                    <td>上海市浦东新区</td>
                                    <td>1,156</td>
                                    <td>13.2%</td>
                                    <td><span class="trend-indicator trend-up">+12.7%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-3">3</span></td>
                                    <td>广州市天河区</td>
                                    <td>987</td>
                                    <td>11.3%</td>
                                    <td><span class="trend-indicator trend-up">+9.2%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-other">4</span></td>
                                    <td>深圳市南山区</td>
                                    <td>856</td>
                                    <td>9.8%</td>
                                    <td><span class="trend-indicator trend-stable">+3.3%</span></td>
                                </tr>
                                <tr>
                                    <td><span class="rank-badge rank-other">5</span></td>
                                    <td>杭州市西湖区</td>
                                    <td>734</td>
                                    <td>8.4%</td>
                                    <td><span class="trend-indicator trend-down">-2.1%</span></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 页面加载时设置用户信息
        document.addEventListener('DOMContentLoaded', function() {
            const currentUser = JSON.parse(localStorage.getItem('dataDashboardCurrentUser') || '{}');
            const isLoggedIn = localStorage.getItem('dataDashboardIsLoggedIn') === 'true';
            
            if (isLoggedIn && currentUser.name) {
                document.getElementById('user-name').textContent = currentUser.name;
                document.getElementById('user-role').textContent = currentUser.role;
                document.getElementById('user-avatar').textContent = currentUser.name.charAt(0);
            }

            // 初始化图表
            initializeCharts();
            
            // 启动实时数据更新
            startRealTimeUpdates();
            
            // 添加页面加载动画
            addPageLoadAnimations();
            
            // 添加滚动动画
            addScrollAnimations();
            
            // 初始化粒子背景
            initParticles();
        });

        // 功能切换
        function switchFunction(functionName) {
            // 隐藏所有内容区域
            const contentSections = document.querySelectorAll('.content-section');
            contentSections.forEach(section => {
                section.classList.remove('active');
            });

            // 移除所有导航链接的active类
            const navLinks = document.querySelectorAll('.nav-link');
            navLinks.forEach(link => {
                link.classList.remove('active');
            });

            // 显示选中的内容区域
            const targetSection = document.getElementById(functionName + '-content');
            if (targetSection) {
                targetSection.classList.add('active');
            }

            // 添加active类到选中的导航链接
            const activeLink = document.querySelector(`[onclick="switchFunction('${functionName}')"]`);
            if (activeLink) {
                activeLink.classList.add('active');
            }
        }

        // 退出登录
        function logout() {
            localStorage.removeItem('dataDashboardCurrentUser');
            localStorage.removeItem('dataDashboardIsLoggedIn');
            window.location.href = 'index.html';
        }

        // 初始化图表
        function initializeCharts() {
            // 登记数量走势图
            const registrationCtx = document.getElementById('registrationTrendChart').getContext('2d');
            new Chart(registrationCtx, {
                type: 'line',
                data: {
                    labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
                    datasets: [{
                        label: '登记数量',
                        data: [1200, 1350, 1420, 1580, 1650, 1780, 1890, 2010, 2150, 2280, 2340, 2450],
                        borderColor: '#00d4ff',
                        backgroundColor: 'rgba(0, 212, 255, 0.15)',
                        borderWidth: 4,
                        fill: true,
                        tension: 0.4,
                        pointBackgroundColor: '#00d4ff',
                        pointBorderColor: '#ffffff',
                        pointBorderWidth: 2,
                        pointRadius: 6,
                        pointHoverRadius: 8,
                        pointHoverBackgroundColor: '#ffffff',
                        pointHoverBorderColor: '#00d4ff'
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            labels: {
                                color: '#ffffff',
                                font: {
                                    size: 14,
                                    weight: 'bold'
                                }
                            }
                        }
                    },
                    scales: {
                        x: {
                            ticks: {
                                color: '#ffffff',
                                font: {
                                    size: 12
                                }
                            },
                            grid: {
                                color: 'rgba(255, 255, 255, 0.1)',
                                borderColor: 'rgba(255, 255, 255, 0.2)'
                            }
                        },
                        y: {
                            ticks: {
                                color: '#ffffff',
                                font: {
                                    size: 12
                                }
                            },
                            grid: {
                                color: 'rgba(255, 255, 255, 0.1)',
                                borderColor: 'rgba(255, 255, 255, 0.2)'
                            }
                        }
                    },
                    elements: {
                        point: {
                            hoverBorderWidth: 3
                        }
                    }
                }
            });

            // 捐献数据统计图
            const donationCtx = document.getElementById('donationStatsChart').getContext('2d');
            new Chart(donationCtx, {
                type: 'bar',
                data: {
                    labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
                    datasets: [{
                        label: '捐献数量',
                        data: [85, 92, 78, 105, 120, 135, 142, 158, 145, 167, 180, 195],
                        backgroundColor: [
                            'rgba(255, 107, 107, 0.8)',
                            'rgba(255, 107, 107, 0.7)',
                            'rgba(255, 107, 107, 0.6)',
                            'rgba(255, 107, 107, 0.9)',
                            'rgba(255, 107, 107, 0.8)',
                            'rgba(255, 107, 107, 0.7)',
                            'rgba(255, 107, 107, 0.8)',
                            'rgba(255, 107, 107, 0.9)',
                            'rgba(255, 107, 107, 0.7)',
                            'rgba(255, 107, 107, 0.8)',
                            'rgba(255, 107, 107, 0.9)',
                            'rgba(255, 107, 107, 0.8)'
                        ],
                        borderColor: '#ff6b6b',
                        borderWidth: 2,
                        borderRadius: 8,
                        borderSkipped: false
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            labels: {
                                color: '#ffffff',
                                font: {
                                    size: 14,
                                    weight: 'bold'
                                }
                            }
                        }
                    },
                    scales: {
                        x: {
                            ticks: {
                                color: '#ffffff',
                                font: {
                                    size: 12
                                }
                            },
                            grid: {
                                color: 'rgba(255, 255, 255, 0.1)',
                                borderColor: 'rgba(255, 255, 255, 0.2)'
                            }
                        },
                        y: {
                            ticks: {
                                color: '#ffffff',
                                font: {
                                    size: 12
                                }
                            },
                            grid: {
                                color: 'rgba(255, 255, 255, 0.1)',
                                borderColor: 'rgba(255, 255, 255, 0.2)'
                            }
                        }
                    }
                }
            });
        }

        // 实时数据更新
        function startRealTimeUpdates() {
            setInterval(() => {
                // 模拟数据更新
                updateStatistics();
            }, 5000); // 每5秒更新一次
        }

        // 更新统计数据
        function updateStatistics() {
            const statCards = document.querySelectorAll('.stat-card');
            statCards.forEach((card, index) => {
                setTimeout(() => {
                    const numberElement = card.querySelector('.stat-number');
                    const currentValue = parseInt(numberElement.textContent.replace(/,/g, ''));
                    const newValue = currentValue + Math.floor(Math.random() * 10);
                    
                    // 添加更新动画
                    card.classList.add('updating');
                    
                    // 数字滚动动画
                    animateNumber(numberElement, currentValue, newValue);
                    
                    // 移除动画
                    setTimeout(() => {
                        card.classList.remove('updating');
                    }, 1000);
                }, index * 200);
            });
        }

        // 数字滚动动画
        function animateNumber(element, start, end) {
            const duration = 1000;
            const startTime = performance.now();
            
            function update(currentTime) {
                const elapsed = currentTime - startTime;
                const progress = Math.min(elapsed / duration, 1);
                
                // 使用缓动函数
                const easeOutQuart = 1 - Math.pow(1 - progress, 4);
                const current = Math.floor(start + (end - start) * easeOutQuart);
                
                element.textContent = current.toLocaleString();
                
                if (progress < 1) {
                    requestAnimationFrame(update);
                } else {
                    element.textContent = end.toLocaleString();
                }
            }
            
            requestAnimationFrame(update);
        }

        // 页面加载动画
        function addPageLoadAnimations() {
            const elements = document.querySelectorAll('.stat-card, .chart-container, .table-container');
            elements.forEach((element, index) => {
                element.style.opacity = '0';
                element.style.transform = 'translateY(30px)';
                
                setTimeout(() => {
                    element.style.transition = 'all 0.8s cubic-bezier(0.4, 0, 0.2, 1)';
                    element.style.opacity = '1';
                    element.style.transform = 'translateY(0)';
                }, index * 150);
            });
        }

        // 滚动动画
        function addScrollAnimations() {
            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.style.opacity = '1';
                        entry.target.style.transform = 'translateY(0)';
                    }
                });
            }, {
                threshold: 0.1,
                rootMargin: '0px 0px -50px 0px'
            });

            const animatedElements = document.querySelectorAll('.stat-card, .chart-container, .table-container');
            animatedElements.forEach(element => {
                element.style.opacity = '0';
                element.style.transform = 'translateY(30px)';
                element.style.transition = 'all 0.6s cubic-bezier(0.4, 0, 0.2, 1)';
                observer.observe(element);
            });
        }

        // 初始化粒子背景
        function initParticles() {
            const particlesContainer = document.getElementById('particles');
            const particleCount = 50;

            for (let i = 0; i < particleCount; i++) {
                const particle = document.createElement('div');
                particle.className = 'particle';
                
                // 随机位置
                particle.style.left = Math.random() * 100 + '%';
                particle.style.top = Math.random() * 100 + '%';
                
                // 随机延迟
                particle.style.animationDelay = Math.random() * 6 + 's';
                
                // 随机大小
                const size = Math.random() * 3 + 1;
                particle.style.width = size + 'px';
                particle.style.height = size + 'px';
                
                // 随机颜色
                const colors = [
                    'rgba(0, 212, 255, 0.6)',
                    'rgba(255, 107, 107, 0.6)',
                    'rgba(78, 205, 196, 0.6)',
                    'rgba(69, 183, 209, 0.6)'
                ];
                particle.style.background = colors[Math.floor(Math.random() * colors.length)];
                
                particlesContainer.appendChild(particle);
            }
        }

        // 添加统计卡片点击事件
        function addCardInteractions() {
            const statCards = document.querySelectorAll('.stat-card');
            statCards.forEach(card => {
                card.addEventListener('click', function() {
                    // 添加点击动画
                    this.classList.add('flash');
                    setTimeout(() => {
                        this.classList.remove('flash');
                    }, 500);
                    
                    // 显示详细信息
                    const label = this.querySelector('.stat-label').textContent;
                    const value = this.querySelector('.stat-number').textContent;
                    showCardDetails(label, value);
                });
            });
        }

        // 显示卡片详细信息
        function showCardDetails(label, value) {
            // 创建模态框显示详细信息
            const modal = document.createElement('div');
            modal.style.cssText = `
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(0, 0, 0, 0.8);
                display: flex;
                align-items: center;
                justify-content: center;
                z-index: 1000;
                backdrop-filter: blur(10px);
            `;
            
            const content = document.createElement('div');
            content.style.cssText = `
                background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
                border-radius: 15px;
                padding: 30px;
                border: 1px solid rgba(255, 255, 255, 0.2);
                backdrop-filter: blur(20px);
                text-align: center;
                color: white;
                max-width: 400px;
                animation: modalSlideIn 0.3s ease;
            `;
            
            content.innerHTML = `
                <h3 style="margin-bottom: 20px; color: #00d4ff;">${label}</h3>
                <div style="font-size: 48px; font-weight: bold; margin-bottom: 20px; background: linear-gradient(45deg, #00d4ff, #ff6b6b); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">${value}</div>
                <p style="margin-bottom: 20px; opacity: 0.8;">点击任意位置关闭</p>
            `;
            
            modal.appendChild(content);
            document.body.appendChild(modal);
            
            // 点击关闭
            modal.addEventListener('click', () => {
                modal.remove();
            });
        }

        // 模态框动画
        const modalSlideIn = `
            @keyframes modalSlideIn {
                from {
                    opacity: 0;
                    transform: translateY(-50px);
                }
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }
        `;
        
        // 添加样式到页面
        const style = document.createElement('style');
        style.textContent = modalSlideIn;
        document.head.appendChild(style);

        // 页面加载完成后添加交互
        document.addEventListener('DOMContentLoaded', function() {
            setTimeout(() => {
                addCardInteractions();
            }, 1000);
        });
    </script>
</body>
</html>
